<template>
  <div class="home">
    <div class="left">
      <el-row class="tac">
        <el-col :span="12">
          <el-menu
            default-active="2"
            class="el-menu-vertical-demo"
            @open="handleOpen"
            @close="handleClose"
            router
          >
            <el-submenu index="1">
              <template slot="title">
                <i class="el-icon-location"></i>
                <span>数据管理</span>
              </template>
              <el-menu-item-group>
                <el-menu-item index="/home/user">用户列表</el-menu-item>
                <el-menu-item index="/home/shop">商家列表</el-menu-item>
              </el-menu-item-group>
            </el-submenu>
          </el-menu>
        </el-col>
      </el-row>
    </div>
    <div class="rigth">
      <router-view></router-view>
    </div>
  </div>
</template>

<script>
export default {
  methods: {
    handleOpen(key, keyPath) {
      console.log(key, keyPath);
    },
    handleClose(key, keyPath) {
      console.log(key, keyPath);
    },
  },
};
</script>
<style lang="scss" scoped>
.home {
  width: 100%;
  height: 100%;
  display: flex;
  .left {
    width: 20%;
    height: 100%;
    background-color: #e6e6e6;
    overflow: hidden;
    .el-col-12 {
      width: 100%;
    }
  }
  .rigth {
    width: 80%;
    height: 100%;
    // background-color: green;
  }
}
</style>